package cn.zn.modules.pz.his.controller;

import cn.hutool.core.collection.CollUtil;
import cn.zn.framework.common.utils.Result;
import cn.zn.modules.invoice.inter.InvoiceRecordInfoInter;
import cn.zn.modules.invoice.inter.vo.InvoiceVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("pz/his/pzinvoice")
public class PzInvoiceController {

    @Autowired(required = false)
    private InvoiceRecordInfoInter invoiceRecordInfoInter;

    @GetMapping("list/{applyCode}")
    @ResponseBody
    public Result invoiceList(@PathVariable String applyCode) {
        List<InvoiceVO> invoiceVOList = CollUtil.newArrayList();
        if (invoiceRecordInfoInter != null) {
            invoiceVOList = invoiceRecordInfoInter.findInvoice(applyCode);
        }
        return Result.ok(invoiceVOList);
    }

}
